package edu.upenn.cis.cis550.hw3.server;

import java.io.IOException;

public class DataImporter {
    QueryExportImpl queryingImport = new QueryExportImpl();
    
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        DataImporter.run();
	}
	
	private static void run() throws IOException, ClassNotFoundException {
	    DataImporter imp = new DataImporter();
	    String fileName = "user.csv";
	    String tableName = "User";  
	    imp.importXML(fileName, tableName);
	    imp.importXML("address.csv", "Address");
	    imp.importXML("advises.csv", "Advises");
	    imp.importXML("circle.csv", "Circle");
	    imp.importXML("friend.csv", "Friend");
	    imp.importXML("interest.csv", "Interest");
	    imp.importXML("login.csv", "Login");
	    imp.importXML("photo.csv", "Photo");
	    imp.importXML("professor.csv", "Professor");
	    imp.importXML("ratinf.csv", "Rating");
	    imp.importXML("student.csv", "Student");
	    imp.importXML("tag.csv", "Tag");
	} 
	
	private void importXML(String fileName, String tableName){
		queryingImport.updateTable(fileName, tableName);
	}
}
